package it.lolled.entity;

public class Post {
	private String id;
	private String title;
	private String img;
	private String source;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getImg() {
		return img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	public Post(String id, String title, String img, String source) {
		super();
		this.id = id;
		this.title = title;
		this.img = img;
		this.source = source;
	}

	public Post() {
		// TODO Auto-generated constructor stub
	}

	public String getInsert() {
		return "INSERT INTO `my_loleconomy`.`post` (`id`, `title`, `image`, `source`) VALUES ('" + repAp(id) + "', '"
				+ repAp(title) + "', '" + repAp(img) + "', '" + repAp(source) + "')";
	}

	private String repAp(String value) {
		return value.replace("'", "''");
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

}
